package cn.lisens.influxdb.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.influxdb.client.InfluxDBClient;
import com.influxdb.client.QueryApi;
import com.influxdb.client.WriteApiBlocking;

@Configuration
public class InfluxDB2Config {
    
    @Bean
    public  WriteApiBlocking writeApi(InfluxDBClient influxDBClient) {
    	return influxDBClient.getWriteApiBlocking();
    }
    
    @Bean
    public  QueryApi queryApi(InfluxDBClient influxDBClient) {
    	return influxDBClient.getQueryApi();
    }
}